package cn.tedu._06article.base.response;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class jsonresoult {
    private Integer status;
    private String message;
    private Object data;
    public jsonresoult(code code)
    {
        this.status = code.getStatus();
        this.message = code.getMessage();
        this.data = null;
    }
    public jsonresoult(code code, Object data)
    {
        this.status = code.getStatus();
        this.message = code.getMessage();
        this.data = data;
    }
    public static jsonresoult success()
    {
        return new jsonresoult(code.SUCCESS);
    }
    public static jsonresoult success(Object data)
    {
        return new jsonresoult(code.SUCCESS, data);
    }
}
